package it.traveldream.entities;

import it.traveldream.dto.ProductTypeDTO;

import java.io.Serializable;
import java.lang.Long;
import java.lang.String;

import javax.persistence.*;

/**
 * Entity implementation class for Entity: ProductType
 *
 */
@Entity
@Table(name="ProductType")

@NamedQuery(
		name = "getAllProductTypes",
		query = "SELECT t FROM ProductType t"
		)
public class ProductType implements Serializable {
	   
	public final static String EXCURSION = "2";
	public final static String TRANSPORTMEAN = "3";
	public final static String HOTEL = "4";
	
	@Id
	private Long productTypeId;
	private String productTypeName;
	private static final long serialVersionUID = 1L;

	public ProductType() {
		super();
	}   
	
	public ProductType(Long id, String name){
		super();
		this.productTypeId = id;
		this.productTypeName = name;
	}
	public Long getProductTypeId() {
		return this.productTypeId;
	}

	public void setProductTypeId(Long productTypeId) {
		this.productTypeId = productTypeId;
	}   
	public String getProductTypeName() {
		return this.productTypeName;
	}

	public void setProductTypeName(String productTypeName) {
		this.productTypeName = productTypeName;
	}

	public ProductTypeDTO toDTO() {
		ProductTypeDTO dto = new ProductTypeDTO();
		dto.setProductTypeId(this.productTypeId);
		dto.setName(this.productTypeName);
		
		return dto;
	}
   
}
